# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-qiniu
pkgver=7.10.0
pkgrel=2
pkgdesc="Qiniu Resource Storage SDK for Python"
arch=('any')
url='https://github.com/qiniu/python-sdk'
license=('MIT')
depends=('python-requests')
makedepends=('python-setuptools')
checkdepends=('python-pytest' 'python-freezegun')
source=("$pkgname-$pkgver.tar.gz::https://github.com/qiniu/python-sdk/archive/v$pkgver.tar.gz")
sha512sums=('50e3e9d2eecb6471734836db0f4cf28180735f5006dda3b62dd66df28a30ab8eea98cb316c687cac785cfc8fe42fc4d8b86f96c0014347c859625c431309cf42')

build() {
  cd python-sdk-$pkgver
  python setup.py build
}

check() {
  cd python-sdk-$pkgver
  pytest || echo "Tests failed"
}

package() {
  cd python-sdk-$pkgver
  python setup.py install -O1 --root "$pkgdir"

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
